package com.myw.mail.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.myw.mail.mapper.LogisticsMapper;
import com.myw.mail.domain.Logistics;
import com.myw.mail.service.ILogisticsService;

/**
 * 物流信息Service业务层处理
 * 
 * @author myw
 * @date 2025-07-10
 */
@Service
@Slf4j
public class LogisticsServiceImpl extends ServiceImpl<LogisticsMapper, Logistics> implements ILogisticsService
{
    @Autowired
    private LogisticsMapper logisticsMapper;

    /**
     * 查询物流信息
     * 
     * @param id 物流信息主键
     * @return 物流信息
     */
    @Override
    public Logistics selectLogisticsById(String id)
    {
        return logisticsMapper.selectLogisticsById(id);
    }

    /**
     * 查询物流信息列表
     * 
     * @param logistics 物流信息
     * @return 物流信息
     */
    @Override
    public List<Logistics> selectLogisticsList(Logistics logistics)
    {
        return logisticsMapper.selectLogisticsList(logistics);
    }

    /**
     * 新增物流信息
     * 
     * @param logistics 物流信息
     * @return 结果
     */
    @Override
    public int insertLogistics(Logistics logistics)
    {
        logistics.setCreateTime(DateUtils.getNowDate());
        return logisticsMapper.insertLogistics(logistics);
    }

    /**
     * 修改物流信息
     * 
     * @param logistics 物流信息
     * @return 结果
     */
    @Override
    public int updateLogistics(Logistics logistics)
    {
        logistics.setUpdateTime(DateUtils.getNowDate());
        return logisticsMapper.updateLogistics(logistics);
    }

    /**
     * 批量删除物流信息
     * 
     * @param ids 需要删除的物流信息主键
     * @return 结果
     */
    @Override
    public int deleteLogisticsByIds(String[] ids)
    {
        return logisticsMapper.deleteLogisticsByIds(ids);
    }

    /**
     * 删除物流信息信息
     * 
     * @param id 物流信息主键
     * @return 结果
     */
    @Override
    public int deleteLogisticsById(String id)
    {
        return logisticsMapper.deleteLogisticsById(id);
    }
}
